Repository navigation
refactor: migrate package layout to src/firstrade_platform - #545
Merged
Merged
Conversation
- Move application, entrypoints, notifications, main, and strategy/runtime modules into src/firstrade_platform/ with updated setuptools, pytest, coverage, Dockerfile, CODEOWNERS, script, and test imports. - Remove pytest from runtime dependencies in pyproject.toml and refresh uv.lock via uv lock. - Add executable check for rg in CI public configuration scan and fix remaining test layout/import checks. - Sync README.md, README.zh-CN.md, AGENTS.md, CONTRIBUTING.md, and docs/ for src/firstrade_platform/ paths. - Update Dependabot actions group/prefix, tighten commitlint rules, add dependabot-policy.json, and drop retired ft-account-facts-sync-once.yml.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Assistance
AI coding assistant (Gemini) completed the
src/firstrade_platform/package layout migration, documentation sync, lockfile update, and verification.What Changed
application/,entrypoints/,notifications/,main.py,decision_mapper.py,runtime_*.py, andstrategy_*.pyintosrc/firstrade_platform/(package-dir = {"" = "src"},where = ["src"]) with updatedDockerfile,CODEOWNERS, script, and test imports.pytestfrom[project].dependenciesinpyproject.toml, updated[tool.pytest.ini_options].pythonpathto["src", "."]and[tool.coverage.run].sourceto["src/firstrade_platform"], and refresheduv.lockwithuv lock.tests/test_coverage_source_layout.pyand the remaining inline import intests/test_rebalance_service.py, and hardened.github/workflows/ci.ymlpublic configuration scan to verifyrgis executable (test -x).README.md,README.zh-CN.md,AGENTS.md,CONTRIBUTING.md,docs/statement-reconciliation.md,docs/statement-reconciliation.zh-CN.md,docs/shared-test-imports.md, and.github/workflows/fee-schedule-check.ymlforsrc/firstrade_platform/paths and documentation links..github/dependabot.yml(actionsgroup +chorecommit prefix while keepingignorerules), added.github/scripts/dependabot-policy.jsonfor.github/workflows/ci.yml, added'build'and'Merge bypass'self-checks in.github/workflows/engineering-governance.yml, and removed the retired.github/workflows/ft-account-facts-sync-once.ymlworkflow.How Verified
uv lock --check: resolved cleanly with no drift afteruv lock.ruff check --exclude external .: passed with zero lint issues.uv run --no-sync python -m pytest -q -p test_support.pytest_provenance --shared-import-mode installed-lock tests/test_shared_import_contract.py: 3 passed (SHARED_IMPORT_PROVENANCE_COMPLETE).coverage run -m pytest -q+coverage report --show-missing: 1857 passed, 118 subtests passed; 37 files measured strictly undersrc/firstrade_platform/(82% total).check_qpk_pin_consistency.pyagainst pinnedQuantPlatformKit: all 3 dependency files match the locked revision.python -m buildwheel inspection: top-level archive contains onlyfirstrade_platform/andfirstrade_platform-0.3.0.dist-info/.check_style.py --root . --phase 2andactionlint -shellcheck= -pyflakes=: 0 blocking findings; clean workflow lint.Why
Adopting a standard
src/package layout prevents root-directory modules from shadowing installed packages and ensures wheel builds ship onlyfirstrade_platform/, while keeping docs, lockfiles, and PR governance rules aligned.Risk
R2 governance and runtime packaging refactor (
scripts/,.github/workflows/,.github/scripts/,src/firstrade_platform/,pyproject.toml,Dockerfile). Offline test suite, wheel packaging, pin consistency, and static checks pass; no deployment, secret mutation, or live execution is performed.